package 线程池;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorServiceDemo {

    public static void main(String[] args) {
        //固定大小的线程池
        ExecutorService fixed = Executors.newFixedThreadPool(4);
        //单线程池
        ExecutorService single = Executors.newSingleThreadExecutor();
        //缓存的线程池
        ExecutorService cached = Executors.newCachedThreadPool();
        //计划任务的线程池
        ExecutorService scheduled = Executors.newScheduledThreadPool(4);
    }
}
